Skip to content

Move __set__ from BaseDescriptor to FieldTypedBaseDescriptor#274

Merged
julianstirling merged 1 commit intomainfrom
basedescriptor-isnt-a-data-descriptor
Mar 2, 2026
Merged

Move __set__ from BaseDescriptor to FieldTypedBaseDescriptor#274
julianstirling merged 1 commit intomainfrom
basedescriptor-isnt-a-data-descriptor

Conversation

@rwb27
Copy link
Copy Markdown
Collaborator

@rwb27 rwb27 commented Mar 2, 2026

Downstream in OpenFlexure, unit tests often patch live objects to mock their actions. This stopped working when BaseDescriptor gained a __set__ method.

Moving __set__ to FieldTypedBaseDescriptor doesn't change any meaningful LabThings functionality but should restore the tests for OpenFlexure.

A quick check suggests that the descriptors that need a __set__ already inherit from FieldTypedBaseDescriptor, so I don't believe this affects anything important to LabThings, and the tests/mypy analysis confirm this.

Downstream in OpenFlexure, unit tests often patch live objects to mock their actions. This stopped working when `BaseDescriptor` gained a `__set__` method.

Moving `__set__` to `FieldTypedBaseDescriptor` doesn't change any meaningful LabThings functionality but should restore the tests for OpenFlexure.
@rwb27 rwb27 requested a review from julianstirling March 2, 2026 16:58
@barecheck
Copy link
Copy Markdown

barecheck bot commented Mar 2, 2026

Barecheck - Code coverage report

Total: 96.52%

Your code coverage diff: 0.00% ▴

Uncovered files and lines
FileLines
src/labthings_fastapi/base_descriptor.py287, 301-302, 610

Copy link
Copy Markdown
Contributor

@julianstirling julianstirling left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have confirmed that the unit tests, integration tests, and server lifecycle tests of the microscope all now pass.

I have also checked the settings all load in the simulation microscope, and the microscope will scans.

@julianstirling julianstirling merged commit 7bd70bd into main Mar 2, 2026
14 checks passed
@julianstirling julianstirling deleted the basedescriptor-isnt-a-data-descriptor branch March 2, 2026 18:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants